   // 云监控列表下拉菜单html字符串
//    let cloudMoniterMenuStr = '';
    // 执行递归渲染云监控列表下拉菜单
   // renderCloudMoniter(cloudMoniterStartParentId, cloudMoniterData);
    // 侧边栏列表下拉菜单html字符串
    let leftMenuStr = '';
//    renderLeftMenu(leftMenuStartParentId, leftMenuData);

//根据数据渲染云监控列表下拉菜单
//id：菜单主键id
//arry：菜单数组信息
//function renderCloudMoniter(id, arry) {
//    let childArry = GetParentArry(id, arry);
//    if(childArry.length > 0) {
//        for(let i = 0; i < childArry.length; i++) {
//            cloudMoniterMenuStr += '<li class="dropdown-user">';
//            cloudMoniterMenuStr += '<a href="javascript:;" data-toggle="dropdown">' + childArry[i].title;
//            if(GetParentArry(childArry[i].id, arry).length !== 0) {
//                cloudMoniterMenuStr += '<span class="caret"></span></a><ul class="moniter-iframe childMenu dropdown-menu dropdown-menu-right">';
//                renderCloudMoniter(childArry[i].id, arry);
//                cloudMoniterMenuStr += '</ul>';
//            } else {
//                cloudMoniterMenuStr += '</a>';
//                renderCloudMoniter(childArry[i].id, arry);
//            }
//            cloudMoniterMenuStr += '</li>'
//        }
//    }
//}
//
//function getLeftMoniterMenu(id, arry){
//	console.log(arry);
//	renderCloudMoniter(id, arry);
//	$("#moniterIframe").html(cloudMoniterMenuStr);
//}


// 确认侧边栏列表默认展开菜单项（通过sn字段值来确认）

// 执行递归渲染侧边栏列表下拉菜单
//根据数据渲染侧边栏列表下拉菜单
//id：菜单主键id
//arry：菜单数组信息
function renderLeftMenu(id, arry) {
    let childArry = GetParentArry(id, arry);
    if(childArry.length > 0) {
        for(let i = 0; i < childArry.length; i++) {
            leftMenuStr += '<li class="';
            if(childArry[i].sn === '${curIndex}') {
                leftMenuStr += 'open';
            }
            leftMenuStr += '"><a href="#" class="dropdown-toggle">';
            if(childArry[i].parentId === leftMenuStartParentId) {
                leftMenuStr += '<i class="menu-icon ' + childArry[i].icon + '"></i>';
            } else {
                leftMenuStr += '<i class="menu-icon fa fa-caret-right"></i>';
            }
            leftMenuStr += '<span class="menu-text">' + childArry[i].title + '</span>';
            if(GetParentArry(childArry[i].id, arry).length !== 0) {
                leftMenuStr += '<b class="arrow fa fa-angle-down"></b>';
            }
            leftMenuStr += '</a><b class="arrow"></b><ul class="submenu">';
            renderLeftMenu(childArry[i].id, arry);
            leftMenuStr += '</li></ul>';
        }
    }
}

function getLeftMenu(id, arry){
	renderLeftMenu(id, arry);
	$(".nav-list").html(leftMenuStr);
}

	//打开菜单
function openMenu(){
	 $('.nav-list .open').parents('li').attr('class', 'open');
}

//根据菜单主键id获取下级菜单（通用）
//id：菜单主键id
//arry：菜单数组信息
//function GetParentArry(id, arr) {
//    let newArry = [];
//    for(let i = 0; i < arr.length; i++) {
//        if(arr[i].parentId === id) {
//            newArry.push(arr[i]);
//        }
//    }
//    return newArry;
//}
